-
-
Notifications
You must be signed in to change notification settings - Fork 83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: 添加基于zip的单文件格式 #290
Merged
Merged
feat: 添加基于zip的单文件格式 #290
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- 在 package.json 中添加 jszip 依赖,版本为 ^3.10.1 - jszip 是一个用于处理 ZIP 文件的 JavaScript 库,可能用于文件压缩或解压功能
- 重构 IndexedDBFileSystem 类,优化文件和目录操作逻辑 - 新增目录创建、读取、重命名和删除功能 - 改进文件重命名和删除,支持自动更新父目录条目 - 优化文件下载时的文件名处理,支持保留文件后缀
- 重构文件打开流程,使用 VFileSystem 统一处理文件读取 - 修改文件路径处理逻辑,支持获取文件名和文件名(含后缀) - 更新文件对话框默认文件名,使用 .gp 后缀
- 重构 VFileSystem 类,增加 pullMetaData 和 saveToPath 方法 - 更新 RecentFileManager 和 StageSaveManager,使用新的文件系统方法 - 修改 ControllerDragFile 和 CopyEngine,使用 VFileSystem 替代直接文件操作 - 更新 StageExportEngine 和 SoundService,使用新的文件读写方法 - 重构 fs/com.tsx,提供统一的文件操作接口
- 在 VFileSystem 中添加 clear 方法,用于清除文件系统数据 - 优化 IndexedDBFileSystem 中的 getStore、addEntryToParent 和 clear 方法 - 删除多余的空格和括号,提高代码可读性
- 在加载文件前,增加清除虚拟文件系统的操作 - 在多个地方添加 VFileSystem.clear() 调用,以确保文件切换时清理虚拟文件系统 - 修改文件加载逻辑,只允许加载 .gp 后缀的文件 - 更新错误提示信息,明确指出需要选择 .gp 文件
- 在 dealPngFileDrop 函数中添加 async/await 以确保文件写入操作是异步执行的 - 在 readClipboardItems 函数中添加 await 以确保文件写入操作完成后再继续执行后续代码
zty012
approved these changes
Feb 2, 2025
对于gp格式,应将所有内容放置在压缩包的根目录,不应放在二级目录里。 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
做了什么?
VFileSystem
层用于临时存储数据问题
目前使用
jszip
处理zip的压缩和解压,在面临较大图片时性能可能不佳。可能需要更换为wasm处理。稳定性需进一步测试